Skip to content

chore(opencode): exclude .map files from CLI binary build#25500

Merged
thdxr merged 1 commit intoanomalyco:devfrom
PanAchy:autoresearch/exclude-map-files-from-cli-binary/01-exclude-map-files-from-cli-binary
May 3, 2026
Merged

chore(opencode): exclude .map files from CLI binary build#25500
thdxr merged 1 commit intoanomalyco:devfrom
PanAchy:autoresearch/exclude-map-files-from-cli-binary/01-exclude-map-files-from-cli-binary

Conversation

@PanAchy
Copy link
Copy Markdown
Contributor

@PanAchy PanAchy commented May 2, 2026

Issue for this PR

Closes #25504

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The CLI build embeds all web UI dist files via a catch-all Bun.Glob("**/*") in build.ts. This catches .map source map files that are only needed for Sentry uploads in the hosted deployment. They are dead weight in a compiled Bun binary.

Adds a .filter() to skip .map files, saving ~24MB (167MB → 144MB).

How did you verify your code works?

  • Built with bun run build --single — binary compiles and passes smoke test (opencode --version)
  • opencode serve serves the web UI correctly without the embedded source maps

Screenshots / recordings

N/A — no UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@PanAchy PanAchy changed the title fix(opencode): exclude .map files from CLI binary perf(opencode): exclude .map files from CLI binary May 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 3, 2026

Hey! Your PR title perf(opencode): exclude .map files from CLI binary doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@PanAchy PanAchy changed the title perf(opencode): exclude .map files from CLI binary perf(opencode): exclude .map files from CLI binary build May 3, 2026
@PanAchy PanAchy changed the title perf(opencode): exclude .map files from CLI binary build chore(opencode): exclude .map files from CLI binary build May 3, 2026
@PanAchy PanAchy force-pushed the autoresearch/exclude-map-files-from-cli-binary/01-exclude-map-files-from-cli-binary branch from f215436 to 60808b8 Compare May 3, 2026 02:39
The CLI build embeds all web UI assets including 25MB of JavaScript source maps (.map files). These are only used for Sentry uploads in the hosted deployment — dead weight in a compiled Bun binary.

One-line filter in build.ts's glob excludes .map files from embedding.

Experiments: anomalyco#2
Metric: size_kb 167,666 → 143,658 (-14.3%)
@PanAchy PanAchy force-pushed the autoresearch/exclude-map-files-from-cli-binary/01-exclude-map-files-from-cli-binary branch from 60808b8 to 4841539 Compare May 3, 2026 02:44
@thdxr thdxr merged commit be88cd5 into anomalyco:dev May 3, 2026
8 checks passed
@PanAchy PanAchy deleted the autoresearch/exclude-map-files-from-cli-binary/01-exclude-map-files-from-cli-binary branch May 3, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Exclude .map source maps from CLI binary build

2 participants